home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
sos3-2_r.lha
/
INSTALL.SOS3-2
next >
Wrap
Text File
|
1992-02-13
|
3KB
|
124 lines
#!/bin/sh
# --------------------------------------------------------------------------
# Copyright 1991, 1992 by Forschungszentrum Informatik (FZI)
#
# You can use and distribute this software under the terms of the licence
# you should have received along with this program.
# If not or if you want additional information, write to
# Forschungszentrum Informatik, "STONE", Haid-und-Neu-Strasse 10-14,
# D-7500 Karlsruhe 1, Germany.
# --------------------------------------------------------------------------
# 'INSTALL - 10/9/91 - Dietmar Theobald'
#
# INSTALL [ -boot ]
#
if [ "$1" = '-boot' ] ; then
final_phase='+'
elif [ $# -ne 0 ] ; then
echo >&2 '*** usage: INSTALL [-boot]'
fi
set SOS*.tar.Z
[ $# -ne 1 ] && { echo >&2 '*** INSTALL: multiple SOS*.tar.Z files'; exit 1 ;}
tarfile="`basename $1 .Z`"
tmpfile=/tmp/INSTALL.$$
WD="`pwd`"
[ "$final_phase" ] || {
echo '
starting installation ...
'
zcat -v $tarfile | tar xvBbf 20 - ; rm -f $tarfile
echo -n '
GNU compiler? (for AT&T type "n") '
read answer
if [ "$answer" = 'n' -o "$answer" = 'N' ] ; then
echo ' using AT&T compiler
'
sedcmd1='s|\[__ATT__\]||'
sedcmd2='s|\[__GNU__\]|#|'
compiler='ATT'
else
echo ' using GNU compiler
'
sedcmd1='s|\[__ATT__\]|#|'
sedcmd2='s|\[__GNU__\]||'
compiler='GNU'
fi
echo -n 'preparing source files '
for file in Makefile commands.mk bin/* src/*/*_scp.c src/*/*_yacc.c \
`find . -name "INSTALL.*" -print`
do
echo -n '.'
sed -e 's|\(#.*line.*"\)/.*\(/src/.*\)|\1'$WD'\2|' \
-e 's+\([^|]\)__SOS_INSTALLED_PATH__+\1'$WD'+' \
-e 's|__COMPILER__|'$compiler'|' \
$file > $tmpfile
case "`basename $file`" in
commands.mk) sed -e "$sedcmd1" -e "$sedcmd2" $tmpfile > $file ;;
INSTALL.*) rm -f $file; mv $tmpfile $file; chmod +x $file ;;
*) rm -f $file; mv $tmpfile $file ;;
esac
done
chmod +x bin/*
echo "
Proceed by customizing the SOS version for your local environment.
Afterwards, finish the installation by 'INSTALL -boot'.
"
exit 0
} # (final_phase)
# ----------------------------
# The final installation phase
# ----------------------------
date
boot_type='full'
arch="`( arch ) 2> /dev/null`"
[ "$arch" = 'sun3' -o "$arch" = 'sun4' ] && boot_type='sun'
echo 'starting bootstrap ($boot_type) ...
'
PATH="$WD/bin:"$PATH; export PATH
SOSCONTAINER="$WD/cnt"; export SOSCONTAINER
SOSC_BOOTING='+'; export SOSC_BOOTING
if [ "$boot_type" = 'sun' ] ; then
make all
else
./bin/sos-boot
fi
rm -f cnt/*.out src/*/*.out *.out
date
for i in 1 2
do
if [ "$i" = '1' ] ; then
what='object files'
cmd="make clear_lib"
else
what='installation files'
cmd="rm -f $tarfile.Z INSTALL"
fi
echo -n "
remove $what? "
read answer
if [ "$answer" = 'y' -o "$answer" = 'Y' ] ; then
echo " $what will be removed"
$cmd
else
echo " $what not removed"
fi
done